package cn.gson.springboot.model.pjos;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Objects;

public class ZproductmodelmiddleEntityPK implements Serializable {
    private int productId;
    private int onsId;

    @Column(name = "product_id", nullable = false)
    @Id
    public int getProductId() {
        return productId;
    }

    public void setProductId(int productId) {
        this.productId = productId;
    }

    @Column(name = "ons_id", nullable = false)
    @Id
    public int getOnsId() {
        return onsId;
    }

    public void setOnsId(int onsId) {
        this.onsId = onsId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ZproductmodelmiddleEntityPK that = (ZproductmodelmiddleEntityPK) o;
        return productId == that.productId &&
                onsId == that.onsId;
    }

    @Override
    public int hashCode() {
        return Objects.hash(productId, onsId);
    }
}
